/**
 *
 */
import OpenApi;
import OpenApi.OpenApiUtil;

extends OpenApi;


init(config: OpenApiUtil.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('dataanalysisgbi', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!$isNull(endpoint)) {
    return endpoint;
  }
  
  if (!$isNull(endpointMap) && !$isNull(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return OpenApiUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model BatchDeleteSynonymsRequest {
  synonymIdKeys?: [ string ](name='synonymIdKeys', description='This parameter is required.'),
  workspaceId?: string(name='workspaceId', description='This parameter is required.', example='llm-2v3934xtp49esw64'),
}

model BatchDeleteSynonymsResponseBody = {
  code?: string(name='code', example='NoAuth'),
  data?: any(name='data', example='true'),
  errorMsg?: string(name='errorMsg', example='NoAuth'),
  requestId?: string(name='requestId', example='45390C6D-016D-5030-BF65-031ED1F65003'),
  success?: boolean(name='success', example='true'),
}

model BatchDeleteSynonymsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BatchDeleteSynonymsResponseBody(name='body'),
}

/**
 * @summary 批量删除当前指定业务空间下的同义词
 *
 * @param request BatchDeleteSynonymsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return BatchDeleteSynonymsResponse
 */
async function batchDeleteSynonymsWithOptions(request: BatchDeleteSynonymsRequest, headers: map[string]string, runtime: $RuntimeOptions): BatchDeleteSynonymsResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.workspaceId)) {
    query['workspaceId'] = request.workspaceId;
  }

  var body : map[string]any = {};
  if (!$isNull(request.synonymIdKeys)) {
    body['synonymIdKeys'] = request.synonymIdKeys;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'BatchDeleteSynonyms',
    version = '2024-08-23',
    protocol = 'HTTPS',
    pathname = `/gbi/batchDelete/synonyms`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 批量删除当前指定业务空间下的同义词
 *
 * @param request BatchDeleteSynonymsRequest
 * @return BatchDeleteSynonymsResponse
 */
async function batchDeleteSynonyms(request: BatchDeleteSynonymsRequest): BatchDeleteSynonymsResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return batchDeleteSynonymsWithOptions(request, headers, runtime);
}

model CancelDatasourceAuthorizationRequest {
  workspaceId?: string(name='workspaceId', description='This parameter is required.', example='llm-2v3934xtp49esw64'),
}

model CancelDatasourceAuthorizationResponseBody = {
  code?: string(name='code', example='NoAuth'),
  data?: any(name='data', example='true'),
  errorMsg?: string(name='errorMsg', example='NoAuth'),
  requestId?: string(name='requestId', example='FB11F719-9AC8-5C99-AB0A-4709D437FCFC'),
  success?: boolean(name='success', example='true'),
}

model CancelDatasourceAuthorizationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CancelDatasourceAuthorizationResponseBody(name='body'),
}

/**
 * @summary 取消关联的数据源授权
 *
 * @param request CancelDatasourceAuthorizationRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CancelDatasourceAuthorizationResponse
 */
async function cancelDatasourceAuthorizationWithOptions(request: CancelDatasourceAuthorizationRequest, headers: map[string]string, runtime: $RuntimeOptions): CancelDatasourceAuthorizationResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.workspaceId)) {
    query['workspaceId'] = request.workspaceId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CancelDatasourceAuthorization',
    version = '2024-08-23',
    protocol = 'HTTPS',
    pathname = `/gbi/cancel/datasource`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 取消关联的数据源授权
 *
 * @param request CancelDatasourceAuthorizationRequest
 * @return CancelDatasourceAuthorizationResponse
 */
async function cancelDatasourceAuthorization(request: CancelDatasourceAuthorizationRequest): CancelDatasourceAuthorizationResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return cancelDatasourceAuthorizationWithOptions(request, headers, runtime);
}

model CreateBusinessLogicRequest {
  description?: string(name='description'),
  type?: int32(name='type', example='1'),
  workspaceId?: string(name='workspaceId', description='This parameter is required.', example='llm-2v3934xtp49esw64'),
}

model CreateBusinessLogicResponseBody = {
  code?: string(name='code', example='NoAuth'),
  data?: any(name='data', example='true'),
  errorMsg?: string(name='errorMsg', example='NoAuth'),
  requestId?: string(name='requestId', example='FB11F719-9AC8-5C99-AB0A-4709D437FCFC'),
  success?: boolean(name='success', example='true'),
}

model CreateBusinessLogicResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateBusinessLogicResponseBody(name='body'),
}

/**
 * @summary 在指定的业务空间下创建新的业务逻辑解释
 *
 * @param request CreateBusinessLogicRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateBusinessLogicResponse
 */
async function createBusinessLogicWithOptions(request: CreateBusinessLogicRequest, headers: map[string]string, runtime: $RuntimeOptions): CreateBusinessLogicResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.workspaceId)) {
    query['workspaceId'] = request.workspaceId;
  }

  var body : map[string]any = {};
  if (!$isNull(request.description)) {
    body['description'] = request.description;
  }
  if (!$isNull(request.type)) {
    body['type'] = request.type;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateBusinessLogic',
    version = '2024-08-23',
    protocol = 'HTTPS',
    pathname = `/gbi/create/logic`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 在指定的业务空间下创建新的业务逻辑解释
 *
 * @param request CreateBusinessLogicRequest
 * @return CreateBusinessLogicResponse
 */
async function createBusinessLogic(request: CreateBusinessLogicRequest): CreateBusinessLogicResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return createBusinessLogicWithOptions(request, headers, runtime);
}

model CreateDatasourceAuthorizationRequest {
  password?: string(name='password', example='password'),
  type?: int32(name='type', description='This parameter is required.', example='1'),
  url?: string(name='url', example='jdbc:mysql://rm-2zedvv990c8d8rj8ejo.mysql.rds.aliyuncs.com:3306/gbi_good_case'),
  userName?: string(name='userName', example='root'),
  vdbId?: string(name='vdbId', example='vdb-E0F693C8-9F72-5830-B81A-696C9D8EBBD1'),
  workspaceId?: string(name='workspaceId', description='This parameter is required.', example='llm-2v3934xtp49esw64'),
}

model CreateDatasourceAuthorizationResponseBody = {
  code?: string(name='code', example='NoAuth'),
  data?: any(name='data', example='true'),
  errorMsg?: string(name='errorMsg', example='NoAuth'),
  requestId?: string(name='requestId', example='E0F693C8-9F72-5830-B81A-696C9D8EBBD1'),
  success?: boolean(name='success', example='true'),
}

model CreateDatasourceAuthorizationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateDatasourceAuthorizationResponseBody(name='body'),
}

/**
 * @summary 创建数据库关联授权
 *
 * @param request CreateDatasourceAuthorizationRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateDatasourceAuthorizationResponse
 */
async function createDatasourceAuthorizationWithOptions(request: CreateDatasourceAuthorizationRequest, headers: map[string]string, runtime: $RuntimeOptions): CreateDatasourceAuthorizationResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.workspaceId)) {
    query['workspaceId'] = request.workspaceId;
  }

  var body : map[string]any = {};
  if (!$isNull(request.password)) {
    body['password'] = request.password;
  }
  if (!$isNull(request.type)) {
    body['type'] = request.type;
  }
  if (!$isNull(request.url)) {
    body['url'] = request.url;
  }
  if (!$isNull(request.userName)) {
    body['userName'] = request.userName;
  }
  if (!$isNull(request.vdbId)) {
    body['vdbId'] = request.vdbId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateDatasourceAuthorization',
    version = '2024-08-23',
    protocol = 'HTTPS',
    pathname = `/gbi/create/datasource`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建数据库关联授权
 *
 * @param request CreateDatasourceAuthorizationRequest
 * @return CreateDatasourceAuthorizationResponse
 */
async function createDatasourceAuthorization(request: CreateDatasourceAuthorizationRequest): CreateDatasourceAuthorizationResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return createDatasourceAuthorizationWithOptions(request, headers, runtime);
}

model CreateSynonymsRequest {
  columns?: [ string ](name='columns'),
  word?: string(name='word', description='This parameter is required.'),
  wordSynonyms?: [ string ](name='wordSynonyms', description='This parameter is required.'),
  workspaceId?: string(name='workspaceId', description='This parameter is required.', example='llm-2v3934xtp49esw64'),
}

model CreateSynonymsResponseBody = {
  code?: string(name='code', example='NoAuth'),
  data?: any(name='data', example='true'),
  errorMsg?: string(name='errorMsg', example='NoAuth'),
  requestId?: string(name='requestId', example='FB11F719-9AC8-5C99-AB0A-4709D437FCFC'),
  success?: boolean(name='success', example='true'),
}

model CreateSynonymsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateSynonymsResponseBody(name='body'),
}

/**
 * @summary 在当前指定的业务空间下面，新建同义词
 *
 * @param request CreateSynonymsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateSynonymsResponse
 */
async function createSynonymsWithOptions(request: CreateSynonymsRequest, headers: map[string]string, runtime: $RuntimeOptions): CreateSynonymsResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.workspaceId)) {
    query['workspaceId'] = request.workspaceId;
  }

  var body : map[string]any = {};
  if (!$isNull(request.columns)) {
    body['columns'] = request.columns;
  }
  if (!$isNull(request.word)) {
    body['word'] = request.word;
  }
  if (!$isNull(request.wordSynonyms)) {
    body['wordSynonyms'] = request.wordSynonyms;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateSynonyms',
    version = '2024-08-23',
    protocol = 'HTTPS',
    pathname = `/gbi/create/synonyms`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 在当前指定的业务空间下面，新建同义词
 *
 * @param request CreateSynonymsRequest
 * @return CreateSynonymsResponse
 */
async function createSynonyms(request: CreateSynonymsRequest): CreateSynonymsResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return createSynonymsWithOptions(request, headers, runtime);
}

model CreateVirtualDatasourceInstanceRequest {
  description?: string(name='description'),
  name?: string(name='name', example='virtual-instance-1'),
  type?: int32(name='type'),
  workspaceId?: string(name='workspaceId', description='This parameter is required.', example='llm-2v3934xtp49esw64'),
}

model CreateVirtualDatasourceInstanceResponseBody = {
  code?: string(name='code', example='NoAuth'),
  data?: any(name='data', example='true'),
  errorMsg?: string(name='errorMsg', example='NoAuth'),
  requestId?: string(name='requestId', example='D02D895A-5E58-5A9F-963D-D8B027AB7AE2'),
  success?: boolean(name='success', example='true'),
}

model CreateVirtualDatasourceInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateVirtualDatasourceInstanceResponseBody(name='body'),
}

/**
 * @summary 在指定的业务空间创建虚拟数据源
 *
 * @param request CreateVirtualDatasourceInstanceRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateVirtualDatasourceInstanceResponse
 */
async function createVirtualDatasourceInstanceWithOptions(request: CreateVirtualDatasourceInstanceRequest, headers: map[string]string, runtime: $RuntimeOptions): CreateVirtualDatasourceInstanceResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.workspaceId)) {
    query['workspaceId'] = request.workspaceId;
  }

  var body : map[string]any = {};
  if (!$isNull(request.description)) {
    body['description'] = request.description;
  }
  if (!$isNull(request.name)) {
    body['name'] = request.name;
  }
  if (!$isNull(request.type)) {
    body['type'] = request.type;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateVirtualDatasourceInstance',
    version = '2024-08-23',
    protocol = 'HTTPS',
    pathname = `/gbi/virtualDatasource/createVirtualDatasourceInstance`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 在指定的业务空间创建虚拟数据源
 *
 * @param request CreateVirtualDatasourceInstanceRequest
 * @return CreateVirtualDatasourceInstanceResponse
 */
async function createVirtualDatasourceInstance(request: CreateVirtualDatasourceInstanceRequest): CreateVirtualDatasourceInstanceResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return createVirtualDatasourceInstanceWithOptions(request, headers, runtime);
}

model DeleteBusinessLogicRequest {
  businessLogicIdKeys?: [ string ](name='businessLogicIdKeys', description='This parameter is required.'),
  workspaceId?: string(name='workspaceId', description='This parameter is required.', example='llm-2v3934xtp49esw64'),
}

model DeleteBusinessLogicResponseBody = {
  code?: string(name='code', example='NoAuth'),
  data?: any(name='data', example='true'),
  errorMsg?: string(name='errorMsg', example='NoAuth'),
  requestId?: string(name='requestId', example='FB11F719-9AC8-5C99-AB0A-4709D437FCFC'),
  success?: boolean(name='success', example='true'),
}

model DeleteBusinessLogicResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteBusinessLogicResponseBody(name='body'),
}

/**
 * @summary 删除指定业务空间下所指定的业务逻辑解释
 *
 * @param request DeleteBusinessLogicRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteBusinessLogicResponse
 */
async function deleteBusinessLogicWithOptions(request: DeleteBusinessLogicRequest, headers: map[string]string, runtime: $RuntimeOptions): DeleteBusinessLogicResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.workspaceId)) {
    query['workspaceId'] = request.workspaceId;
  }

  var body : map[string]any = {};
  if (!$isNull(request.businessLogicIdKeys)) {
    body['businessLogicIdKeys'] = request.businessLogicIdKeys;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteBusinessLogic',
    version = '2024-08-23',
    protocol = 'HTTPS',
    pathname = `/gbi/delete/logic`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除指定业务空间下所指定的业务逻辑解释
 *
 * @param request DeleteBusinessLogicRequest
 * @return DeleteBusinessLogicResponse
 */
async function deleteBusinessLogic(request: DeleteBusinessLogicRequest): DeleteBusinessLogicResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteBusinessLogicWithOptions(request, headers, runtime);
}

model DeleteColumnRequest {
  columnIdKey?: string(name='columnIdKey', description='This parameter is required.', example='column-AAAAAAAAh6Q9ERazKYFvkA'),
  workspaceId?: string(name='workspaceId', description='This parameter is required.', example='llm-2v3934xtp49esw64'),
}

model DeleteColumnResponseBody = {
  code?: string(name='code', example='NoAuth'),
  data?: any(name='data', example='true'),
  errorMsg?: string(name='errorMsg', example='NoAuth'),
  requestId?: string(name='requestId', example='D02D895A-5E58-5A9F-963D-D8B027AB7AE2'),
  success?: boolean(name='success', example='true'),
}

model DeleteColumnResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteColumnResponseBody(name='body'),
}

/**
 * @summary 从当前所指定的业务空间中，删除所指定的列
 *
 * @param request DeleteColumnRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteColumnResponse
 */
async function deleteColumnWithOptions(request: DeleteColumnRequest, headers: map[string]string, runtime: $RuntimeOptions): DeleteColumnResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.workspaceId)) {
    query['workspaceId'] = request.workspaceId;
  }

  var body : map[string]any = {};
  if (!$isNull(request.columnIdKey)) {
    body['columnIdKey'] = request.columnIdKey;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteColumn',
    version = '2024-08-23',
    protocol = 'HTTPS',
    pathname = `/gbi/delete/column`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 从当前所指定的业务空间中，删除所指定的列
 *
 * @param request DeleteColumnRequest
 * @return DeleteColumnResponse
 */
async function deleteColumn(request: DeleteColumnRequest): DeleteColumnResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteColumnWithOptions(request, headers, runtime);
}

model DeleteSelectedTableRequest {
  tableIdKey?: string(name='tableIdKey', description='This parameter is required.', example='table-AAAAAAAAFQBwSLJkUj4CYg'),
  workspaceId?: string(name='workspaceId', description='This parameter is required.', example='llm-2v3934xtp49esw64'),
}

model DeleteSelectedTableResponseBody = {
  code?: string(name='code', example='NoAuth'),
  data?: any(name='data', example='true'),
  errorMsg?: string(name='errorMsg', example='NoAuth'),
  requestId?: string(name='requestId', example='45390C6D-016D-5030-BF65-031ED1F65003'),
  success?: boolean(name='success', example='true'),
}

model DeleteSelectedTableResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteSelectedTableResponseBody(name='body'),
}

/**
 * @summary 将当前指定数据表从指定业务空间管控中删除
 *
 * @param request DeleteSelectedTableRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteSelectedTableResponse
 */
async function deleteSelectedTableWithOptions(request: DeleteSelectedTableRequest, headers: map[string]string, runtime: $RuntimeOptions): DeleteSelectedTableResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.workspaceId)) {
    query['workspaceId'] = request.workspaceId;
  }

  var body : map[string]any = {};
  if (!$isNull(request.tableIdKey)) {
    body['tableIdKey'] = request.tableIdKey;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteSelectedTable',
    version = '2024-08-23',
    protocol = 'HTTPS',
    pathname = `/gbi/delete/table`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 将当前指定数据表从指定业务空间管控中删除
 *
 * @param request DeleteSelectedTableRequest
 * @return DeleteSelectedTableResponse
 */
async function deleteSelectedTable(request: DeleteSelectedTableRequest): DeleteSelectedTableResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteSelectedTableWithOptions(request, headers, runtime);
}

model DeleteVirtualDatasourceInstanceRequest {
  vdbId?: string(name='vdbId', description='This parameter is required.', example='vdb-7D63529B-5D42-5BF0-84E4-F742FFE02E7F'),
  workspaceId?: string(name='workspaceId', description='This parameter is required.', example='llm-2v3934xtp49esw64'),
}

model DeleteVirtualDatasourceInstanceResponseBody = {
  code?: string(name='code', example='NoAuth'),
  data?: any(name='data', example='true'),
  errorMsg?: string(name='errorMsg', example='NoAuth'),
  requestId?: string(name='requestId', example='7D63529B-5D42-5BF0-84E4-F742FFE02E7F'),
  success?: boolean(name='success', example='true'),
}

model DeleteVirtualDatasourceInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteVirtualDatasourceInstanceResponseBody(name='body'),
}

/**
 * @summary 删除指定业务空间下面的虚拟数据源实例
 *
 * @param request DeleteVirtualDatasourceInstanceRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteVirtualDatasourceInstanceResponse
 */
async function deleteVirtualDatasourceInstanceWithOptions(request: DeleteVirtualDatasourceInstanceRequest, headers: map[string]string, runtime: $RuntimeOptions): DeleteVirtualDatasourceInstanceResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.workspaceId)) {
    query['workspaceId'] = request.workspaceId;
  }

  var body : map[string]any = {};
  if (!$isNull(request.vdbId)) {
    body['vdbId'] = request.vdbId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteVirtualDatasourceInstance',
    version = '2024-08-23',
    protocol = 'HTTPS',
    pathname = `/gbi/virtualDatasource/deleteVirtualDatasourceInstance`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除指定业务空间下面的虚拟数据源实例
 *
 * @param request DeleteVirtualDatasourceInstanceRequest
 * @return DeleteVirtualDatasourceInstanceResponse
 */
async function deleteVirtualDatasourceInstance(request: DeleteVirtualDatasourceInstanceRequest): DeleteVirtualDatasourceInstanceResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteVirtualDatasourceInstanceWithOptions(request, headers, runtime);
}

model ListBusinessLogicRequest {
  maxResults?: int32(name='maxResults', example='10'),
  nextToken?: string(name='nextToken', example='e8Z0nRyY51ZQmYljqGNK'),
  workspaceId?: string(name='workspaceId', description='This parameter is required.', example='llm-2v3934xtp49esw64'),
}

model ListBusinessLogicResponseBody = {
  code?: string(name='code', example='NoAuth'),
  data?: any(name='data'),
  errorMsg?: string(name='errorMsg', example='NoAuth'),
  requestId?: string(name='requestId', example='FB11F719-9AC8-5C99-AB0A-4709D437FCFC'),
  success?: boolean(name='success', example='true'),
}

model ListBusinessLogicResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListBusinessLogicResponseBody(name='body'),
}

/**
 * @summary 获取当前指定业务空间下的企业知识名词解释列表
 *
 * @param request ListBusinessLogicRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListBusinessLogicResponse
 */
async function listBusinessLogicWithOptions(request: ListBusinessLogicRequest, headers: map[string]string, runtime: $RuntimeOptions): ListBusinessLogicResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.workspaceId)) {
    query['workspaceId'] = request.workspaceId;
  }

  var body : map[string]any = {};
  if (!$isNull(request.maxResults)) {
    body['maxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    body['nextToken'] = request.nextToken;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListBusinessLogic',
    version = '2024-08-23',
    protocol = 'HTTPS',
    pathname = `/gbi/list/logic`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取当前指定业务空间下的企业知识名词解释列表
 *
 * @param request ListBusinessLogicRequest
 * @return ListBusinessLogicResponse
 */
async function listBusinessLogic(request: ListBusinessLogicRequest): ListBusinessLogicResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listBusinessLogicWithOptions(request, headers, runtime);
}

model ListColumnRequest {
  maxResults?: int32(name='maxResults', example='10'),
  nextToken?: int32(name='nextToken', example='e8Z0nRyY51ZQmYljqGNK'),
  tableIdKey?: string(name='tableIdKey', description='This parameter is required.'),
  workspaceId?: string(name='workspaceId', description='This parameter is required.', example='llm-2v3934xtp49esw64'),
}

model ListColumnResponseBody = {
  code?: string(name='code', example='NoAuth'),
  data?: any(name='data'),
  errorMsg?: string(name='errorMsg', example='NoAuth'),
  requestId?: string(name='requestId', example='FB11F719-9AC8-5C99-AB0A-4709D437FCFC'),
  success?: boolean(name='success', example='true'),
}

model ListColumnResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListColumnResponseBody(name='body'),
}

/**
 * @summary 获取当前指定业务空间，指定表下面的列信息
 *
 * @param request ListColumnRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListColumnResponse
 */
async function listColumnWithOptions(request: ListColumnRequest, headers: map[string]string, runtime: $RuntimeOptions): ListColumnResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.workspaceId)) {
    query['workspaceId'] = request.workspaceId;
  }

  var body : map[string]any = {};
  if (!$isNull(request.maxResults)) {
    body['maxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    body['nextToken'] = request.nextToken;
  }
  if (!$isNull(request.tableIdKey)) {
    body['tableIdKey'] = request.tableIdKey;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListColumn',
    version = '2024-08-23',
    protocol = 'HTTPS',
    pathname = `/gbi/list/column`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取当前指定业务空间，指定表下面的列信息
 *
 * @param request ListColumnRequest
 * @return ListColumnResponse
 */
async function listColumn(request: ListColumnRequest): ListColumnResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listColumnWithOptions(request, headers, runtime);
}

model ListEnumMappingRequest {
  columnIdKey?: string(name='columnIdKey', description='This parameter is required.', example='column-AAAAAAAAh6cWOUPagYstkg'),
  tableIdKey?: string(name='tableIdKey', description='This parameter is required.', example='table-AAAAAAAAFQBwSLJkUj4CYg'),
  workspaceId?: string(name='workspaceId', description='This parameter is required.', example='llm-2v3934xtp49esw64'),
}

model ListEnumMappingResponseBody = {
  code?: string(name='code', example='NoAuth'),
  data?: any(name='data'),
  errorMsg?: string(name='errorMsg', example='NoAuth'),
  requestId?: string(name='requestId', example='FB11F719-9AC8-5C99-AB0A-4709D437FCFC'),
  success?: boolean(name='success', example='true'),
}

model ListEnumMappingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListEnumMappingResponseBody(name='body'),
}

/**
 * @summary 获取当前业务空间，指定表、列下的枚举值
 *
 * @param request ListEnumMappingRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListEnumMappingResponse
 */
async function listEnumMappingWithOptions(request: ListEnumMappingRequest, headers: map[string]string, runtime: $RuntimeOptions): ListEnumMappingResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.workspaceId)) {
    query['workspaceId'] = request.workspaceId;
  }

  var body : map[string]any = {};
  if (!$isNull(request.columnIdKey)) {
    body['columnIdKey'] = request.columnIdKey;
  }
  if (!$isNull(request.tableIdKey)) {
    body['tableIdKey'] = request.tableIdKey;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListEnumMapping',
    version = '2024-08-23',
    protocol = 'HTTPS',
    pathname = `/gbi/list/mapping`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取当前业务空间，指定表、列下的枚举值
 *
 * @param request ListEnumMappingRequest
 * @return ListEnumMappingResponse
 */
async function listEnumMapping(request: ListEnumMappingRequest): ListEnumMappingResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listEnumMappingWithOptions(request, headers, runtime);
}

model ListSelectedTablesRequest {
  maxResults?: int32(name='maxResults', example='10'),
  nextToken?: string(name='nextToken', example='e8Z0nRyY51ZQmYljqGNK'),
  workspaceId?: string(name='workspaceId', description='This parameter is required.', example='llm-2v3934xtp49esw64'),
}

model ListSelectedTablesResponseBody = {
  code?: string(name='code', example='NoAuth'),
  data?: any(name='data'),
  errorMsg?: string(name='errorMsg', example='NoAuth'),
  requestId?: string(name='requestId', example='FB11F719-9AC8-5C99-AB0A-4709D437FCFC'),
  success?: boolean(name='success', example='true'),
}

model ListSelectedTablesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListSelectedTablesResponseBody(name='body'),
}

/**
 * @summary 获取当前业务空间处于以关联状态的数据表
 *
 * @param request ListSelectedTablesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListSelectedTablesResponse
 */
async function listSelectedTablesWithOptions(request: ListSelectedTablesRequest, headers: map[string]string, runtime: $RuntimeOptions): ListSelectedTablesResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.workspaceId)) {
    query['workspaceId'] = request.workspaceId;
  }

  var body : map[string]any = {};
  if (!$isNull(request.maxResults)) {
    body['maxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    body['nextToken'] = request.nextToken;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListSelectedTables',
    version = '2024-08-23',
    protocol = 'HTTPS',
    pathname = `/gbi/list/datasource/table`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取当前业务空间处于以关联状态的数据表
 *
 * @param request ListSelectedTablesRequest
 * @return ListSelectedTablesResponse
 */
async function listSelectedTables(request: ListSelectedTablesRequest): ListSelectedTablesResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listSelectedTablesWithOptions(request, headers, runtime);
}

model ListSynonymsRequest {
  maxResults?: long(name='maxResults', example='10'),
  nextToken?: string(name='nextToken', example='e8Z0nRyY51ZQmYljqGNK'),
  workspaceId?: string(name='workspaceId', description='This parameter is required.', example='llm-2v3934xtp49esw64'),
}

model ListSynonymsResponseBody = {
  code?: string(name='code', example='NoAuth'),
  data?: any(name='data', example='{
  "data": {
    "data": [
      {
        "gmtModified": 1734401404000,
        "columns": [
          "test.id",
          "user_info.createdt"
        ],
        "synonymIdKey": "synonyms-AAAAAAAAAVLaD8z63NnFhA",
        "wordSynonyms": [
          "1"
        ],
        "workSpaceId": "10024809",
        "gmtCreate": 1734401404000,
        "word": "1",
        "status": 1
      }
    ],
    "nextToken": "k1BLjEN114wyfrhDHoJlbg==",
    "totalCount": 0
  }
}'),
  errorMsg?: string(name='errorMsg', example='NoAuth'),
  requestId?: string(name='requestId', example='D02D895A-5E58-5A9F-963D-D8B027AB7AE2'),
  success?: boolean(name='success', example='true'),
}

model ListSynonymsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListSynonymsResponseBody(name='body'),
}

/**
 * @summary 获取当前指定业务空间下的同义词列表
 *
 * @param request ListSynonymsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListSynonymsResponse
 */
async function listSynonymsWithOptions(request: ListSynonymsRequest, headers: map[string]string, runtime: $RuntimeOptions): ListSynonymsResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.workspaceId)) {
    query['workspaceId'] = request.workspaceId;
  }

  var body : map[string]any = {};
  if (!$isNull(request.maxResults)) {
    body['maxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    body['nextToken'] = request.nextToken;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListSynonyms',
    version = '2024-08-23',
    protocol = 'HTTPS',
    pathname = `/gbi/list/synonyms`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取当前指定业务空间下的同义词列表
 *
 * @param request ListSynonymsRequest
 * @return ListSynonymsResponse
 */
async function listSynonyms(request: ListSynonymsRequest): ListSynonymsResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listSynonymsWithOptions(request, headers, runtime);
}

model ListVirtualDatasourceInstanceRequest {
  maxResults?: int32(name='maxResults', example='100'),
  nextToken?: string(name='nextToken', example='e8Z0nRyY51ZQmYljqGNK'),
  workspaceId?: string(name='workspaceId', description='This parameter is required.', example='llm-2v3934xtp49esw64'),
}

model ListVirtualDatasourceInstanceResponseBody = {
  code?: string(name='code', example='NoAuth'),
  data?: any(name='data'),
  errorMsg?: string(name='errorMsg', example='NoAuth'),
  requestId?: string(name='requestId', example='45390C6D-016D-5030-BF65-031ED1F65003'),
  success?: boolean(name='success', example='true'),
}

model ListVirtualDatasourceInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListVirtualDatasourceInstanceResponseBody(name='body'),
}

/**
 * @summary 获取当前业务空间下的数据源实例列表
 *
 * @param request ListVirtualDatasourceInstanceRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListVirtualDatasourceInstanceResponse
 */
async function listVirtualDatasourceInstanceWithOptions(request: ListVirtualDatasourceInstanceRequest, headers: map[string]string, runtime: $RuntimeOptions): ListVirtualDatasourceInstanceResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.workspaceId)) {
    query['workspaceId'] = request.workspaceId;
  }

  var body : map[string]any = {};
  if (!$isNull(request.maxResults)) {
    body['maxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    body['nextToken'] = request.nextToken;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListVirtualDatasourceInstance',
    version = '2024-08-23',
    protocol = 'HTTPS',
    pathname = `/gbi/virtualDatasource/listVirtualDatasourceInstance`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取当前业务空间下的数据源实例列表
 *
 * @param request ListVirtualDatasourceInstanceRequest
 * @return ListVirtualDatasourceInstanceResponse
 */
async function listVirtualDatasourceInstance(request: ListVirtualDatasourceInstanceRequest): ListVirtualDatasourceInstanceResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listVirtualDatasourceInstanceWithOptions(request, headers, runtime);
}

model RecoverColumnRequest {
  columnIdKey?: string(name='columnIdKey', description='This parameter is required.', example='column-AAAAAAAAh6cWOUPagYstkg'),
  tableIdKey?: string(name='tableIdKey', description='This parameter is required.', example='table-AAAAAAAAFQBwSLJkUj4CYg'),
  workspaceId?: string(name='workspaceId', description='This parameter is required.', example='llm-2v3934xtp49esw64'),
}

model RecoverColumnResponseBody = {
  code?: string(name='code', example='NoAuth'),
  data?: any(name='data', example='true'),
  errorMsg?: string(name='errorMsg', example='NoAuth'),
  requestId?: string(name='requestId', example='FB11F719-9AC8-5C99-AB0A-4709D437FCFC'),
  success?: boolean(name='success', example='true'),
}

model RecoverColumnResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RecoverColumnResponseBody(name='body'),
}

/**
 * @summary 将指定数据表的数据列恢复到初始话状态
 *
 * @param request RecoverColumnRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return RecoverColumnResponse
 */
async function recoverColumnWithOptions(request: RecoverColumnRequest, headers: map[string]string, runtime: $RuntimeOptions): RecoverColumnResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.workspaceId)) {
    query['workspaceId'] = request.workspaceId;
  }

  var body : map[string]any = {};
  if (!$isNull(request.columnIdKey)) {
    body['columnIdKey'] = request.columnIdKey;
  }
  if (!$isNull(request.tableIdKey)) {
    body['tableIdKey'] = request.tableIdKey;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'RecoverColumn',
    version = '2024-08-23',
    protocol = 'HTTPS',
    pathname = `/gbi/recover/column`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 将指定数据表的数据列恢复到初始话状态
 *
 * @param request RecoverColumnRequest
 * @return RecoverColumnResponse
 */
async function recoverColumn(request: RecoverColumnRequest): RecoverColumnResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return recoverColumnWithOptions(request, headers, runtime);
}

model ResyncTableRequest {
  keep?: boolean(name='keep'),
  tableIdKey?: string(name='tableIdKey', description='This parameter is required.', example='table-AAAAAAAAFQBwSLJkUj4CYg'),
  workspaceId?: string(name='workspaceId', description='This parameter is required.', example='llm-2v3934xtp49esw64'),
}

model ResyncTableResponseBody = {
  code?: string(name='code', example='NoAuth'),
  data?: any(name='data', example='true'),
  errorMsg?: string(name='errorMsg', example='NoAuth'),
  requestId?: string(name='requestId', example='FB11F719-9AC8-5C99-AB0A-4709D437FCFC'),
  success?: boolean(name='success', example='true'),
}

model ResyncTableResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ResyncTableResponseBody(name='body'),
}

/**
 * @summary 从远程数据库刷新当前所关联的数据表信息
 *
 * @param request ResyncTableRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ResyncTableResponse
 */
async function resyncTableWithOptions(request: ResyncTableRequest, headers: map[string]string, runtime: $RuntimeOptions): ResyncTableResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.workspaceId)) {
    query['workspaceId'] = request.workspaceId;
  }

  var body : map[string]any = {};
  if (!$isNull(request.keep)) {
    body['keep'] = request.keep;
  }
  if (!$isNull(request.tableIdKey)) {
    body['tableIdKey'] = request.tableIdKey;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ResyncTable',
    version = '2024-08-23',
    protocol = 'HTTPS',
    pathname = `/gbi/refresh/table`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 从远程数据库刷新当前所关联的数据表信息
 *
 * @param request ResyncTableRequest
 * @return ResyncTableResponse
 */
async function resyncTable(request: ResyncTableRequest): ResyncTableResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return resyncTableWithOptions(request, headers, runtime);
}

model RunDataAnalysisRequest {
  agentCtrlParams?: any(name='agentCtrlParams'),
  dataRole?: [ string ](name='dataRole'),
  generateSqlOnly?: boolean(name='generateSqlOnly', example='true'),
  query?: string(name='query', description='This parameter is required.'),
  sessionId?: string(name='sessionId', example='sessionID'),
  specificationType?: string(name='specificationType', example='STANDARD_MIX'),
  userParams?: any(name='userParams'),
}

model RunDataAnalysisResponseBody = {
  code?: string(name='code'),
  data?: {
    attempts?: [ any ](name='attempts'),
    chat?: {
      text?: string(name='text'),
    }(name='chat'),
    errorMessage?: string(name='errorMessage', example='Access was denied, message: No such namespace namespaces/tech-scp-chain7.'),
    event?: string(name='event', example='rewrite'),
    evidence?: string(name='evidence'),
    httpStatusCode?: long(name='httpStatusCode'),
    requestId?: string(name='requestId', example='DA2578F7-88A5-5D6E-9305-33E724E97D60'),
    rewrite?: string(name='rewrite'),
    selector?: [ string ](name='selector'),
    sessionId?: string(name='sessionId', example='sessionid1'),
    sql?: string(name='sql', example='select p.product_id, p.product_name, sum(o.quantity) as total_sales from products p join orders o on p.product_id = o.product_id where o.order_date between \\\\"2022-10-22\\\\" and \\\\"2024-10-22\\\\" group by p.product_id, p.product_name having total_sales > 5'),
    sqlData?: {
      column?: [ string ](name='column'),
      data?: [  map[string]any ](name='data'),
    }(name='sqlData'),
    sqlError?: string(name='sqlError', example='Can not issue data manipulation statements with executeQuery()'),
    visualization?: {
      data?: {
        option?: string(name='option'),
        plotType?: string(name='plotType', example='bar'),
        stack?: boolean(name='stack'),
        xAxis?: [ string ](name='xAxis'),
        yAxis?: [ string ](name='yAxis'),
      }(name='data'),
      text?: string(name='text'),
    }(name='visualization'),
  }(name='data'),
  httpStatusCode?: long(name='httpStatusCode'),
  message?: string(name='message'),
}

model RunDataAnalysisResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunDataAnalysisResponseBody(name='body'),
}

/**
 * @summary 运行数据分析
 *
 * @param request RunDataAnalysisRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunDataAnalysisResponse
 */
async function runDataAnalysisWithOptions(workspaceId: string, request: RunDataAnalysisRequest, headers: map[string]string, runtime: $RuntimeOptions): RunDataAnalysisResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.agentCtrlParams)) {
    body['agentCtrlParams'] = request.agentCtrlParams;
  }
  if (!$isNull(request.dataRole)) {
    body['dataRole'] = request.dataRole;
  }
  if (!$isNull(request.generateSqlOnly)) {
    body['generateSqlOnly'] = request.generateSqlOnly;
  }
  if (!$isNull(request.query)) {
    body['query'] = request.query;
  }
  if (!$isNull(request.sessionId)) {
    body['sessionId'] = request.sessionId;
  }
  if (!$isNull(request.specificationType)) {
    body['specificationType'] = request.specificationType;
  }
  if (!$isNull(request.userParams)) {
    body['userParams'] = request.userParams;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'RunDataAnalysis',
    version = '2024-08-23',
    protocol = 'HTTPS',
    pathname = `/${$URL.percentEncode(workspaceId)}/gbi/runDataAnalysis`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 运行数据分析
 *
 * @param request RunDataAnalysisRequest
 * @return RunDataAnalysisResponse
 */
async function runDataAnalysis(workspaceId: string, request: RunDataAnalysisRequest): RunDataAnalysisResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return runDataAnalysisWithOptions(workspaceId, request, headers, runtime);
}

model RunDataResultAnalysisRequest {
  analysisMode?: string(name='analysisMode', example='all'),
  requestId?: string(name='requestId', description='This parameter is required.', example='FF76AD3F-8B32-567E-819B-0D3738917006'),
  sqlData?: {
    column?: [ string ](name='column'),
    data?: [ map[string]string ](name='data'),
  }(name='sqlData'),
  workspaceId?: string(name='workspaceId', description='This parameter is required.', example='llm-2v3934xtp49esw64'),
}

model RunDataResultAnalysisResponseBody = {
  data?: {
    errorMessage?: string(name='errorMessage', example='Access was denied, message: No such namespace namespaces/tech-scp-chain7.'),
    event?: string(name='event', example='result'),
    requestId?: string(name='requestId', example='DA2578F7-88A5-5D6E-9305-33E724E97D60'),
    rewrite?: string(name='rewrite'),
    sql?: string(name='sql', example='select p.product_id, p.product_name, sum(o.quantity) as total_sales from products p join orders o on p.product_id = o.product_id where o.order_date between \\\\"2022-10-22\\\\" and \\\\"2024-10-22\\\\" group by p.product_id, p.product_name having total_sales > 5'),
    visualization?: {
      data?: {
        plotType?: string(name='plotType', example='bar'),
        xAxis?: [ string ](name='xAxis'),
        yAxis?: [ string ](name='yAxis'),
      }(name='data'),
      text?: string(name='text'),
    }(name='visualization'),
  }(name='data'),
}

model RunDataResultAnalysisResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunDataResultAnalysisResponseBody(name='body'),
}

/**
 * @summary 对结构化结果进行分析、可视化信息生成
 *
 * @param request RunDataResultAnalysisRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunDataResultAnalysisResponse
 */
async function runDataResultAnalysisWithOptions(request: RunDataResultAnalysisRequest, headers: map[string]string, runtime: $RuntimeOptions): RunDataResultAnalysisResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.workspaceId)) {
    query['workspaceId'] = request.workspaceId;
  }

  var body : map[string]any = {};
  if (!$isNull(request.analysisMode)) {
    body['analysisMode'] = request.analysisMode;
  }
  if (!$isNull(request.requestId)) {
    body['requestId'] = request.requestId;
  }
  if (!$isNull(request.sqlData)) {
    body['sqlData'] = request.sqlData;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'RunDataResultAnalysis',
    version = '2024-08-23',
    protocol = 'HTTPS',
    pathname = `/gbi/runDataResultAnalysis`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 对结构化结果进行分析、可视化信息生成
 *
 * @param request RunDataResultAnalysisRequest
 * @return RunDataResultAnalysisResponse
 */
async function runDataResultAnalysis(request: RunDataResultAnalysisRequest): RunDataResultAnalysisResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return runDataResultAnalysisWithOptions(request, headers, runtime);
}

model RunSqlGenerationRequest {
  query?: string(name='query', description='This parameter is required.'),
  sessionId?: string(name='sessionId', example='d5eced84-fd25-43ee-a245-adb4e4a8c3be'),
  specificationType?: string(name='specificationType', example='STANDARD_MIX'),
  workspaceId?: string(name='workspaceId', description='This parameter is required.', example='llm-2v3934xtp49esw64'),
}

model RunSqlGenerationResponseBody = {
  data?: {
    chat?: {
      text?: string(name='text'),
    }(name='chat'),
    errorMessage?: string(name='errorMessage', example='Access was denied, message: No such namespace namespaces/tech-scp-chain7.'),
    event?: string(name='event', example='sql'),
    evidence?: string(name='evidence'),
    requestId?: string(name='requestId', example='DA2578F7-88A5-5D6E-9305-33E724E97D60'),
    rewrite?: string(name='rewrite'),
    selector?: [ string ](name='selector'),
    sessionId?: string(name='sessionId', example='f64c38dd-a235-4bb4-ae6c-79eaedcba699'),
    sql?: string(name='sql', example='select p.product_id, p.product_name, sum(o.quantity) as total_sales from products p join orders o on p.product_id = o.product_id where o.order_date between \\\\"2022-10-22\\\\" and \\\\"2024-10-22\\\\" group by p.product_id, p.product_name having total_sales > 5'),
    sqlError?: string(name='sqlError', example='Can not issue data manipulation statements with executeQuery()'),
  }(name='data'),
}

model RunSqlGenerationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunSqlGenerationResponseBody(name='body'),
}

/**
 * @summary 运行sql生成
 *
 * @param request RunSqlGenerationRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunSqlGenerationResponse
 */
async function runSqlGenerationWithOptions(request: RunSqlGenerationRequest, headers: map[string]string, runtime: $RuntimeOptions): RunSqlGenerationResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.workspaceId)) {
    query['workspaceId'] = request.workspaceId;
  }

  var body : map[string]any = {};
  if (!$isNull(request.query)) {
    body['query'] = request.query;
  }
  if (!$isNull(request.sessionId)) {
    body['sessionId'] = request.sessionId;
  }
  if (!$isNull(request.specificationType)) {
    body['specificationType'] = request.specificationType;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'RunSqlGeneration',
    version = '2024-08-23',
    protocol = 'HTTPS',
    pathname = `/gbi/runSqlGeneration`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 运行sql生成
 *
 * @param request RunSqlGenerationRequest
 * @return RunSqlGenerationResponse
 */
async function runSqlGeneration(request: RunSqlGenerationRequest): RunSqlGenerationResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return runSqlGenerationWithOptions(request, headers, runtime);
}

model SaveVirtualDatasourceDdlRequest {
  ddl?: string(name='ddl', description='This parameter is required.'),
  vdbId?: string(name='vdbId', description='This parameter is required.', example='vdb-E0F693C8-9F72-5830-B81A-696C9D8EBBD1'),
  workspaceId?: string(name='workspaceId', description='This parameter is required.', example='llm-2v3934xtp49esw64'),
}

model SaveVirtualDatasourceDdlResponseBody = {
  code?: string(name='code', example='NoAuth'),
  data?: any(name='data', example='true'),
  errorMsg?: string(name='errorMsg', example='NoAuth'),
  requestId?: string(name='requestId', example='72ABCA5B-1E93-55D3-8A61-6D8A03CC5C8B'),
  success?: boolean(name='success', example='true'),
}

model SaveVirtualDatasourceDdlResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SaveVirtualDatasourceDdlResponseBody(name='body'),
}

/**
 * @summary 向当前指定的业务空间下的指定虚拟数据源实例添加ddl语句
 *
 * @param request SaveVirtualDatasourceDdlRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return SaveVirtualDatasourceDdlResponse
 */
async function saveVirtualDatasourceDdlWithOptions(request: SaveVirtualDatasourceDdlRequest, headers: map[string]string, runtime: $RuntimeOptions): SaveVirtualDatasourceDdlResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.workspaceId)) {
    query['workspaceId'] = request.workspaceId;
  }

  var body : map[string]any = {};
  if (!$isNull(request.ddl)) {
    body['ddl'] = request.ddl;
  }
  if (!$isNull(request.vdbId)) {
    body['vdbId'] = request.vdbId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'SaveVirtualDatasourceDdl',
    version = '2024-08-23',
    protocol = 'HTTPS',
    pathname = `/gbi/virtualDatasource/addDdl2VirtualInstance`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 向当前指定的业务空间下的指定虚拟数据源实例添加ddl语句
 *
 * @param request SaveVirtualDatasourceDdlRequest
 * @return SaveVirtualDatasourceDdlResponse
 */
async function saveVirtualDatasourceDdl(request: SaveVirtualDatasourceDdlRequest): SaveVirtualDatasourceDdlResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return saveVirtualDatasourceDdlWithOptions(request, headers, runtime);
}

model SyncRemoteTablesRequest {
  keepTableNames?: [ string ](name='keepTableNames'),
  noModifiedTableNames?: [ string ](name='noModifiedTableNames'),
  pullSamples?: boolean(name='pullSamples', example='true'),
  tableNames?: [ string ](name='tableNames', description='This parameter is required.'),
  workspaceId?: string(name='workspaceId', description='This parameter is required.', example='llm-2v3934xtp49esw64'),
}

model SyncRemoteTablesResponseBody = {
  code?: string(name='code', example='NoAuth'),
  data?: any(name='data', example='true'),
  errorMsg?: string(name='errorMsg', example='NoAuth'),
  requestId?: string(name='requestId', example='E9563C85-5810-5835-B68C-78580BC3169E'),
  success?: boolean(name='success', example='true'),
}

model SyncRemoteTablesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SyncRemoteTablesResponseBody(name='body'),
}

/**
 * @summary 更新当前业务空间所关联的数据表
 *
 * @param request SyncRemoteTablesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return SyncRemoteTablesResponse
 */
async function syncRemoteTablesWithOptions(request: SyncRemoteTablesRequest, headers: map[string]string, runtime: $RuntimeOptions): SyncRemoteTablesResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.workspaceId)) {
    query['workspaceId'] = request.workspaceId;
  }

  var body : map[string]any = {};
  if (!$isNull(request.keepTableNames)) {
    body['keepTableNames'] = request.keepTableNames;
  }
  if (!$isNull(request.noModifiedTableNames)) {
    body['noModifiedTableNames'] = request.noModifiedTableNames;
  }
  if (!$isNull(request.pullSamples)) {
    body['pullSamples'] = request.pullSamples;
  }
  if (!$isNull(request.tableNames)) {
    body['tableNames'] = request.tableNames;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'SyncRemoteTables',
    version = '2024-08-23',
    protocol = 'HTTPS',
    pathname = `/gbi/update/datasource/tables`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新当前业务空间所关联的数据表
 *
 * @param request SyncRemoteTablesRequest
 * @return SyncRemoteTablesResponse
 */
async function syncRemoteTables(request: SyncRemoteTablesRequest): SyncRemoteTablesResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return syncRemoteTablesWithOptions(request, headers, runtime);
}

model UpdateBusinessLogicRequest {
  businessLogicIdKey?: string(name='businessLogicIdKey', description='This parameter is required.', example='businessLogic-AAAAAAAAAGAIyJoP7LbKuA'),
  description?: string(name='description', description='This parameter is required.'),
  type?: long(name='type', description='This parameter is required.', example='0'),
  workspaceId?: string(name='workspaceId', description='This parameter is required.', example='llm-2v3934xtp49esw64'),
}

model UpdateBusinessLogicResponseBody = {
  code?: string(name='code', example='NoAuth'),
  data?: any(name='data', example='true'),
  errorMsg?: string(name='errorMsg', example='NoAuth'),
  requestId?: string(name='requestId', example='FB11F719-9AC8-5C99-AB0A-4709D437FCFC'),
  success?: boolean(name='success', example='true'),
}

model UpdateBusinessLogicResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateBusinessLogicResponseBody(name='body'),
}

/**
 * @summary 修改当前指定业务空间下所指定的业务逻辑解释
 *
 * @param request UpdateBusinessLogicRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateBusinessLogicResponse
 */
async function updateBusinessLogicWithOptions(request: UpdateBusinessLogicRequest, headers: map[string]string, runtime: $RuntimeOptions): UpdateBusinessLogicResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.workspaceId)) {
    query['workspaceId'] = request.workspaceId;
  }

  var body : map[string]any = {};
  if (!$isNull(request.businessLogicIdKey)) {
    body['businessLogicIdKey'] = request.businessLogicIdKey;
  }
  if (!$isNull(request.description)) {
    body['description'] = request.description;
  }
  if (!$isNull(request.type)) {
    body['type'] = request.type;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateBusinessLogic',
    version = '2024-08-23',
    protocol = 'HTTPS',
    pathname = `/gbi/update/logic`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 修改当前指定业务空间下所指定的业务逻辑解释
 *
 * @param request UpdateBusinessLogicRequest
 * @return UpdateBusinessLogicResponse
 */
async function updateBusinessLogic(request: UpdateBusinessLogicRequest): UpdateBusinessLogicResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return updateBusinessLogicWithOptions(request, headers, runtime);
}

model UpdateColumnRequest {
  chineseName?: string(name='chineseName'),
  columnIdKey?: string(name='columnIdKey', description='This parameter is required.', example='column-AAAAAAAAh6cWOUPagYstkg'),
  description?: string(name='description'),
  enumType?: int32(name='enumType', description='This parameter is required.', example='1'),
  enumValues?: [ string ](name='enumValues'),
  rangeMax?: long(name='rangeMax', example='2000'),
  rangeMin?: long(name='rangeMin', example='0'),
  samples?: [ string ](name='samples'),
  tableIdKey?: string(name='tableIdKey', description='This parameter is required.', example='table-AAAAAAAAFQBwSLJkUj4CYg'),
  workspaceId?: string(name='workspaceId', description='This parameter is required.', example='llm-2v3934xtp49esw64'),
}

model UpdateColumnResponseBody = {
  code?: string(name='code', example='NoAuth'),
  data?: any(name='data', example='true'),
  errorMsg?: string(name='errorMsg', example='NoAuth'),
  requestId?: string(name='requestId', example='45390C6D-016D-5030-BF65-031ED1F65003'),
  success?: boolean(name='success', example='true'),
}

model UpdateColumnResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateColumnResponseBody(name='body'),
}

/**
 * @summary 修改当前指定业务空间中，指定列的信息
 *
 * @param request UpdateColumnRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateColumnResponse
 */
async function updateColumnWithOptions(request: UpdateColumnRequest, headers: map[string]string, runtime: $RuntimeOptions): UpdateColumnResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.workspaceId)) {
    query['workspaceId'] = request.workspaceId;
  }

  var body : map[string]any = {};
  if (!$isNull(request.chineseName)) {
    body['chineseName'] = request.chineseName;
  }
  if (!$isNull(request.columnIdKey)) {
    body['columnIdKey'] = request.columnIdKey;
  }
  if (!$isNull(request.description)) {
    body['description'] = request.description;
  }
  if (!$isNull(request.enumType)) {
    body['enumType'] = request.enumType;
  }
  if (!$isNull(request.enumValues)) {
    body['enumValues'] = request.enumValues;
  }
  if (!$isNull(request.rangeMax)) {
    body['rangeMax'] = request.rangeMax;
  }
  if (!$isNull(request.rangeMin)) {
    body['rangeMin'] = request.rangeMin;
  }
  if (!$isNull(request.samples)) {
    body['samples'] = request.samples;
  }
  if (!$isNull(request.tableIdKey)) {
    body['tableIdKey'] = request.tableIdKey;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateColumn',
    version = '2024-08-23',
    protocol = 'HTTPS',
    pathname = `/gbi/update/column`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 修改当前指定业务空间中，指定列的信息
 *
 * @param request UpdateColumnRequest
 * @return UpdateColumnResponse
 */
async function updateColumn(request: UpdateColumnRequest): UpdateColumnResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return updateColumnWithOptions(request, headers, runtime);
}

model UpdateEnumMappingRequest {
  columnIdKey?: string(name='columnIdKey', description='This parameter is required.', example='column-AAAAAAAAh6cWOUPagYstkg'),
  enumMapping?: map[string][ string ](name='enumMapping'),
  tableIdKey?: string(name='tableIdKey', description='This parameter is required.', example='table-AAAAAAAAFQBwSLJkUj4CYg'),
  workspaceId?: string(name='workspaceId', description='This parameter is required.', example='llm-2v3934xtp49esw64'),
}

model UpdateEnumMappingResponseBody = {
  code?: string(name='code', example='NoAuth'),
  data?: any(name='data', example='true'),
  errorMsg?: string(name='errorMsg', example='NoAuth'),
  requestId?: string(name='requestId', example='FB11F719-9AC8-5C99-AB0A-4709D437FCFC'),
  success?: boolean(name='success', example='true'),
}

model UpdateEnumMappingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateEnumMappingResponseBody(name='body'),
}

/**
 * @summary 修改当前指定业务空间指定列下的枚举值信息
 *
 * @param request UpdateEnumMappingRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateEnumMappingResponse
 */
async function updateEnumMappingWithOptions(request: UpdateEnumMappingRequest, headers: map[string]string, runtime: $RuntimeOptions): UpdateEnumMappingResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.workspaceId)) {
    query['workspaceId'] = request.workspaceId;
  }

  var body : map[string]any = {};
  if (!$isNull(request.columnIdKey)) {
    body['columnIdKey'] = request.columnIdKey;
  }
  if (!$isNull(request.enumMapping)) {
    body['enumMapping'] = request.enumMapping;
  }
  if (!$isNull(request.tableIdKey)) {
    body['tableIdKey'] = request.tableIdKey;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateEnumMapping',
    version = '2024-08-23',
    protocol = 'HTTPS',
    pathname = `/gbi/update/mapping`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 修改当前指定业务空间指定列下的枚举值信息
 *
 * @param request UpdateEnumMappingRequest
 * @return UpdateEnumMappingResponse
 */
async function updateEnumMapping(request: UpdateEnumMappingRequest): UpdateEnumMappingResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return updateEnumMappingWithOptions(request, headers, runtime);
}

model UpdateSynonymsRequest {
  columns?: [ string ](name='columns'),
  synonymIdKey?: string(name='synonymIdKey', description='This parameter is required.', example='synonyms-AAAAAAAAAUpwTTVrwTFJwQ'),
  word?: string(name='word', description='This parameter is required.'),
  wordSynonyms?: [ string ](name='wordSynonyms', description='This parameter is required.'),
  workspaceId?: string(name='workspaceId', description='This parameter is required.', example='llm-2v3934xtp49esw64'),
}

model UpdateSynonymsResponseBody = {
  code?: string(name='code', example='NoAuth'),
  data?: any(name='data', example='true'),
  errorMsg?: string(name='errorMsg', example='NoAuth'),
  requestId?: string(name='requestId', example='7D63529B-5D42-5BF0-84E4-F742FFE02E7F'),
  success?: boolean(name='success', example='true'),
}

model UpdateSynonymsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateSynonymsResponseBody(name='body'),
}

/**
 * @summary 修改当前业务空间指定的同义词信息
 *
 * @param request UpdateSynonymsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateSynonymsResponse
 */
async function updateSynonymsWithOptions(request: UpdateSynonymsRequest, headers: map[string]string, runtime: $RuntimeOptions): UpdateSynonymsResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.workspaceId)) {
    query['workspaceId'] = request.workspaceId;
  }

  var body : map[string]any = {};
  if (!$isNull(request.columns)) {
    body['columns'] = request.columns;
  }
  if (!$isNull(request.synonymIdKey)) {
    body['synonymIdKey'] = request.synonymIdKey;
  }
  if (!$isNull(request.word)) {
    body['word'] = request.word;
  }
  if (!$isNull(request.wordSynonyms)) {
    body['wordSynonyms'] = request.wordSynonyms;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateSynonyms',
    version = '2024-08-23',
    protocol = 'HTTPS',
    pathname = `/gbi/update/synonyms`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 修改当前业务空间指定的同义词信息
 *
 * @param request UpdateSynonymsRequest
 * @return UpdateSynonymsResponse
 */
async function updateSynonyms(request: UpdateSynonymsRequest): UpdateSynonymsResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return updateSynonymsWithOptions(request, headers, runtime);
}

model UpdateTableInfoRequest {
  description?: string(name='description'),
  foreignKeys?: [ string ](name='foreignKeys'),
  primaryKey?: string(name='primaryKey', example='id'),
  tableIdKey?: string(name='tableIdKey', description='This parameter is required.', example='table-AAAAAAAAFQBwSLJkUj4CYg'),
  workspaceId?: string(name='workspaceId', description='This parameter is required.', example='llm-2v3934xtp49esw64'),
}

model UpdateTableInfoResponseBody = {
  code?: string(name='code', example='NoAuth'),
  data?: any(name='data', example='true'),
  errorMsg?: string(name='errorMsg', example='NoAuth'),
  requestId?: string(name='requestId', example='E9563C85-5810-5835-B68C-78580BC3169E'),
  success?: boolean(name='success', example='true'),
}

model UpdateTableInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateTableInfoResponseBody(name='body'),
}

/**
 * @summary 修改当前所指定的数据表的信息
 *
 * @param request UpdateTableInfoRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateTableInfoResponse
 */
async function updateTableInfoWithOptions(request: UpdateTableInfoRequest, headers: map[string]string, runtime: $RuntimeOptions): UpdateTableInfoResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.workspaceId)) {
    query['workspaceId'] = request.workspaceId;
  }

  var body : map[string]any = {};
  if (!$isNull(request.description)) {
    body['description'] = request.description;
  }
  if (!$isNull(request.foreignKeys)) {
    body['foreignKeys'] = request.foreignKeys;
  }
  if (!$isNull(request.primaryKey)) {
    body['primaryKey'] = request.primaryKey;
  }
  if (!$isNull(request.tableIdKey)) {
    body['tableIdKey'] = request.tableIdKey;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateTableInfo',
    version = '2024-08-23',
    protocol = 'HTTPS',
    pathname = `/gbi/update/table`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 修改当前所指定的数据表的信息
 *
 * @param request UpdateTableInfoRequest
 * @return UpdateTableInfoResponse
 */
async function updateTableInfo(request: UpdateTableInfoRequest): UpdateTableInfoResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return updateTableInfoWithOptions(request, headers, runtime);
}

model UpdateVirtualDatasourceInstanceRequest {
  description?: string(name='description'),
  name?: string(name='name'),
  type?: int32(name='type'),
  vdbId?: string(name='vdbId', description='This parameter is required.', example='vdb-E0F693C8-9F72-5830-B81A-696C9D8EBBD1'),
  workspaceId?: string(name='workspaceId', example='llm-2v3934xtp49esw64'),
}

model UpdateVirtualDatasourceInstanceResponseBody = {
  code?: string(name='code', example='NoAuth'),
  data?: any(name='data', example='true'),
  errorMsg?: string(name='errorMsg', example='NoAuth'),
  requestId?: string(name='requestId', example='E9563C85-5810-5835-B68C-78580BC3169E'),
  success?: boolean(name='success', example='true'),
}

model UpdateVirtualDatasourceInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateVirtualDatasourceInstanceResponseBody(name='body'),
}

/**
 * @summary 修改指定业务空间下所指定的虚拟数据源的信息
 *
 * @param request UpdateVirtualDatasourceInstanceRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateVirtualDatasourceInstanceResponse
 */
async function updateVirtualDatasourceInstanceWithOptions(request: UpdateVirtualDatasourceInstanceRequest, headers: map[string]string, runtime: $RuntimeOptions): UpdateVirtualDatasourceInstanceResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.workspaceId)) {
    query['workspaceId'] = request.workspaceId;
  }

  var body : map[string]any = {};
  if (!$isNull(request.description)) {
    body['description'] = request.description;
  }
  if (!$isNull(request.name)) {
    body['name'] = request.name;
  }
  if (!$isNull(request.type)) {
    body['type'] = request.type;
  }
  if (!$isNull(request.vdbId)) {
    body['vdbId'] = request.vdbId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateVirtualDatasourceInstance',
    version = '2024-08-23',
    protocol = 'HTTPS',
    pathname = `/gbi/virtualDatasource/updateVirtualDatasourceInstance`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 修改指定业务空间下所指定的虚拟数据源的信息
 *
 * @param request UpdateVirtualDatasourceInstanceRequest
 * @return UpdateVirtualDatasourceInstanceResponse
 */
async function updateVirtualDatasourceInstance(request: UpdateVirtualDatasourceInstanceRequest): UpdateVirtualDatasourceInstanceResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return updateVirtualDatasourceInstanceWithOptions(request, headers, runtime);
}

